package com.my.study.design.ruleParallel;

import com.my.study.design.ruleParallel.entity.User;
import com.my.study.design.ruleParallel.suppor.AddressRule;
import com.my.study.design.ruleParallel.suppor.AgeRule;

import java.util.Collections;

/**
 * @author: yidujun
 * @create: 2021/07/14 10:38
 */
public class RuleParallelTest {

    public static void main(String[] args) {
        User user = new User();
        user.setAge(5);
        user.setAddress("湖南");

        boolean execute = RuleService.create()
                .or(Collections.singletonList(new AgeRule()))
                .and(new AddressRule())
                .execute(user);

        System.out.println(execute);
    }

}
